num = int(input("请输入一个整数: "))
sum = 0
for i in range(num+1):
    sum += i

print("1~n的和为:%d",sum)